<template>
    <a-breadcrumb  class="loc">
        <a-breadcrumb-item>控制台</a-breadcrumb-item>
        <template v-for="(item,i) in nowroute" :key="i">
            <a-breadcrumb-item v-if="item.meta.icon" >{{item.meta.title}}</a-breadcrumb-item>
        </template>
        
    </a-breadcrumb>
</template>
<style lang="less" scoped>
.loc{
    line-height: 64px;
}
</style>
<script>
import { defineComponent,ref,watch } from 'vue'
import { useRoute } from 'vue-router'

export default defineComponent({
    setup() {
        const route=useRoute();        
        
        const nowroute=ref([]);
        watch(
            ()=>route.matched,
            ()=>{
                nowroute.value=route.matched.slice(1);
                //console.log(route.matched.slice(1));
            }
        );

       
        return{
            nowroute
        }

    },
})
</script>
